1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.collect;
18
19 import com.google.common.annotations.GwtCompatible;
20 import com.google.gwt.user.client.rpc.SerializationException;
21 import com.google.gwt.user.client.rpc.SerializationStreamReader;
22 import com.google.gwt.user.client.rpc.SerializationStreamWriter;
23
24
25
26
27
28
29
30 @GwtCompatible(emulated = true)
31 public class RegularImmutableAsList_CustomFieldSerializer {
32
33 public static void deserialize(SerializationStreamReader reader,
34 RegularImmutableAsList<?> instance) {
35 }
36
37 public static RegularImmutableAsList<Object> instantiate(
38 SerializationStreamReader reader) throws SerializationException {
39 @SuppressWarnings("unchecked")
40 ImmutableCollection<Object> delegateCollection = (ImmutableCollection) reader.readObject();
41 ImmutableList<?> delegateList = (ImmutableList<?>) reader.readObject();
42 return new RegularImmutableAsList<Object>(delegateCollection, delegateList);
43 }
44
45 public static void serialize(SerializationStreamWriter writer,
46 RegularImmutableAsList<?> instance) throws SerializationException {
47 writer.writeObject(instance.delegateCollection());
48 writer.writeObject(instance.delegateList());
49 }
50 }